#include <mockcpp/mockcpp.hpp>
#include <testngpp/testngpp.hpp>
#include <Length.h>
#include <BaseFormat.h>
#include <sstream>


USING_MOCKCPP_NS
USING_TESTNGPP_NS

FIXTURE(Length)
{
	TEST(should be able to compare feet with inch )
    {
		ASSERT_EQ(Length(1, FEET), Length(2,INCH));
	}
	
	TEST(should be able to compare yard with inch )
    {
		ASSERT_EQ(Length(1, YARD), Length(3*2, INCH));
	}
	
	TEST(should be able to compare mile with inch )
    {
		ASSERT_EQ(Length(1, MILE), Length(1760*3*2, INCH));
	}
	
	TEST(should be able to compare yard with feet )
    {
		ASSERT_EQ(Length(1,YARD), Length(3,FEET));
	}
	
	TEST(should be able to compare mile with feet )
    {
		ASSERT_EQ(Length(1, MILE), Length(1760*3,FEET));
	}

	TEST(should be able to compare mile with yard )
    {
		ASSERT_EQ(Length(1, MILE), Length(1760, YARD));
	}
	TEST(should be able to add inch, feet, yard and mile )
    {
		ASSERT_EQ(Length(1,INCH)+Length(1,FEET)+Length(1,YARD)+Length(1,MILE), Length(1+2+3*2+1760*3*2, INCH));
	}
	#if 0
	TEST(should be able to print Length on cascade format)
    {
        Length len=Length(1,FEET) + Length(1,INCH);
		std::stringstream ss;
		len.toString(ss,CASCADE_FORMAT);
        ASSERT_EQ(ss.str(), string("1 FEET 1 INCH"));
	}
	#endif
	TEST(should be able to print Length On Base format)
    {
        Length len = Length(1,FEET) + Length(1,INCH);
		std::stringstream ss;
		len.toString(ss,BASE_FORMAT);
        ASSERT_EQ(ss.str(), std::string("3 INCH"));
	}
};
